export default {
	data() {
		return {
			currentPath: ''
		}
	},
	onLoad() {
		// 设置当前路径
		const pages = getCurrentPages()
		const page = pages[pages.length - 1]
		this.currentPath = '/' + page.route
	},
	methods: {
		isActive(path) {
			return this.currentPath === path
		},
		navigateTo(path) {
			if (this.currentPath !== path) {
				uni.switchTab({
					url: path
				})
			}
		}
	}
} 